<template>
  <div>
  <van-nav-bar title="商品详情" left-text="返回" @click-left="change" left-arrow>
  <template #right>
  </template>
</van-nav-bar>

<img width="342px" :src="$host+menus.img" alt="">
<p>{{menus.goodsname}}</p> 
<van-button type="primary">加入购物车</van-button>
  </div>
</template>

<script>
import {getgood,getxinxi} from "../radio/index"
export default {
    created(){
    // console.log(this.$route.params.id);
    this.getimg()
    },
data(){
    return{
    menus:[]
    }
},
methods:{
    change(id){
        this.$router.push("/index")
    },
    async getimg(){
    let res=await getxinxi({params:{id:this.$route.params.id}})
    this.menus=res.list[0]
    }
}
}
</script>

<style>
p{
    font-weight: bold;
}
</style>